<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>修改操舱执行登记</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <style>
        ul li,
        ul li div div select,
        ul li div div input {
            font-size: 14px !important;
            ;
        }

        .aui-list-item-label {
            width: 220px !important;
            text-align: center;
        }

        .aui-list-item-input-small {
            width: 140px !important;
            position: relative;
        }

        input::-webkit-input-placeholder {
            /*Webkit browsers*/
            color: rgb(241, 11, 11);
            font-size: 16px;
        }

        input:-moz-placeholder {
            /*Mozilla Firefox 4 to 8*/
            color: rgb(241, 11, 11);
            font-size: 16px;
        }

        input::moz-placeholder {
            /*Mozilla Firefox 19+*/
            color: rgb(241, 11, 11);
            font-size: 16px;
        }

        input:-ms-input-placeholder {
            /*Internet Explorer 10+*/
            color: rgb(241, 11, 11);
            font-size: 16px;
        }

        .aui-list-item-input-small>input {
            width: 90px;
        }

        .aui-list-item-input-small>span {
            position: absolute;
            display: inline-block;
            height: 30px;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
        }

        .aui-list-item-label-width {
            width: 530px !important;
        }

        .aui-list-item-input>label {
            margin-left: 10px;
        }

        .aui-radio {
            margin-right: 10px;
        }

        .aui-radio,
        .aui-checkbox {
            width: 25px !important;
            height: 25px !important;
            margin-right: 5px;
        }

        .textarea-container {
            width: 100%;
            margin: 0 auto;
        }

        .textarea-container>div:nth-child(1) {
            text-align: center;
            font-size: 17px;
        }

        .textarea-container>div:nth-child(2) {
            padding: 10px;
        }

        .textarea-wrapper {
            min-height: 100px;
            border: 1px solid rgba(0, 0, 0, 0.3);
            width: 97%;
            margin: 20px auto 5px auto;
            border-radius: 5px;
        }

        .submit-btn-bottom {
            font-size: 16px;
            margin: 30px auto;
            text-align: center;
        }

        .submit-btn-bottom>button {
            border: none;
            outline: none;
            background-color: #0064B0;
            height: 50px;
            width: 150px;
            color: #fff;
        }
    </style>
</head>

<body>
    <main id="app">
        <div class="aui-content aui-margin-b-15">
            <ul class="aui-list aui-form-list">
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            舱次编号
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" placeholder="无需填写" id="corCfId">
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            舱内总人数
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" placeholder="无需填写" id="corTotalNumberPeople">
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            压力
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" id="corPressure" placeholder="无需填写"><span>ATA</span>
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            舱室
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" id="corCiId" disabled="disabled" placeholder="无需填写">
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            加压时间
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" id="corCompressionTime" placeholder="无需填写">
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            稳压时间
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" id="corStableTime" placeholder="无需填写">
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            减压时间
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" id="corReduceTime" placeholder="无需填写">
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            出舱时间:
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" id="corOutCabinTime" placeholder="无需填写">
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            开舱次数
                        </div>
                        <div class="aui-list-item-input">
                            <input type="number" id="corTotalNumber" placeholder="开舱次数">
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            进舱人数
                        </div>
                        <div class="aui-list-item-input">
                            <input type="number" id="corWarehousing" disabled="disabled" placeholder="无需填写">
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            新病人数
                        </div>
                        <div class="aui-list-item-input">
                            <input type="number" id="corNewPatients" placeholder="新病人数">
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            操舱方式
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corOperationCabin">
                                <option value="电脑">电脑</option>
                                <option value="电子">电子</option>
                                <option value="手动">手动</option>
                            </select>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            单独开舱
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corAlone">
                                <option value="否">否</option>
                                <option value="是">是</option>
                            </select>
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            舱内抢救
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corRescue">
                                <option value="否">否</option>
                                <option value="是">是</option>
                            </select>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            吸氧时程1：
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corProgrammeOne">

                            </select>
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            吸氧时程2
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corProgrammeTwo">

                            </select>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            治疗总时程
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small">
                            <input type="number" id="corTreatmentDuration" placeholder="治疗总时程"><span>min</span>
                        </div>
                    </div>
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            第一次吸氧末
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small">
                            <input type="number" id="corOxygenOne" placeholder="第一次吸氧末"><span>%</span>
                        </div>
                    </div>

                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            第二次吸氧末
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small" style="color: red;">
                            <input type="number" id="corOxygenTwo" placeholder="第二次吸氧末"><span>%</span>
                        </div>
                    </div>
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            第三次吸氧末
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small">
                            <input type="number" id="corOxygenThree" placeholder="第三次吸氧末"><span>%</span>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            减压末
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small">
                            <input type="number" id="corReduceConcentration" placeholder="减压末"><span>%</span>
                        </div>
                    </div>
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            加压前
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small">
                            <input type="number" id="corCompressionTemp" placeholder="加压前"><span>°C</span>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            稳压始
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small">
                            <input type="number" id="corStableTemp" placeholder="稳压始"><span>°C</span>
                        </div>
                    </div>
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            减压始
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small">
                            <input type="number" id="corDecompressionTemp" placeholder="减压始"><span>°C</span>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner" style="justify-content: flex-start;">
                        <div class="aui-list-item-label" style="width: 130px !important;">
                            减压末温度
                        </div>
                        <div class="aui-list-item-input aui-list-item-input-small">
                            <input type="number" id="corReduceDegree" placeholder="减压末"><span>°C</span>
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            技师
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corTechnician">

                            </select>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            医师
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corPhysician">

                            </select>
                        </div>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            护士111
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corNurse">

                            </select>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">

                    <!-- <div class="aui-list-item-inner"> -->
                        <!-- <div class="aui-list-item-label">
                            操舱者1
                        </div>
                        <div class="aui-list-item-input">
                            <select id="corOneName">

                            </select>
                        </div> -->
                        <div class="aui-list-item-inner" style="justify-content: flex-start;">
                            <div class="aui-list-item-label" style="width: 130px !important;">
                                操舱者1
                            </div>
                            <div class="aui-list-item-input aui-list-item-input-small">
                                <input type="text" id="corOneName" placeholder="操舱者1">
                            </div>
                        </div>
                    <!-- </div> -->
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            操舱者2
                        </div>
                        <div class="aui-list-item-input">
                        <select id="corTwoName">
    
                        </select> 
                    </div>
                    </div>
                </li>

            </ul>
            <div class="textarea-container">
                <div>备注</div>
                <div contenteditable="true" class="textarea-wrapper" id="corRemarks">
                
                </div>
            </div>
        </div>
        <div>
            <div class="submit-btn-bottom">
                <button id="Preservatio" onclick="getHoCabinOperationRecord()">查看</button>
                <button id="Preservatio" onclick="updateHoCabinOperationRecord()">修改</button>
            </div>
        </div>
    </main>
</body>

</html>

<script src="../script/api.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/vue.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/jquery.min.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/ToConfigure.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-toast.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-dialog.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-tab.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript">
    // function ceshishi() {
    //     alert($("#corRemarks").text());
    // }

    window.apiready = function () {
            /**
             * 查询当前信息
             * */
             getHoCabinOperationRecord();
             Dictionaries()
        } 
    var vm;
    apiready = function () {
        vm = new Vue({
            el: '#app',
            data: {
                checked: false,
                Url_IP: "",
                Query_UserList: [], //舱室操舱人员信息
                OperatinRecord: [], //舱次信息
                DictionaryLibrary: [],
                F_Id: 0,
                ParameterIdentification: 0, //0为修改   1为添加
            },
            created() {

                //获取舱室Id
                this.F_Id = api.pageParam.F_id;

                //判断是否获取到舱室Id
                if (this.F_Id !== "0") {
                    getHoCabinFrequency();
                    getHoCabinFrequencyPeople();
                    Dictionaries();
                    // getUserInformation();

                }
            },
            methods: {

            }
        });
    }

    //获取信息
    function loaging() {
        getHoCabinFrequency();
        getHoCabinFrequencyPeople();
        // getUserInformation();
    }

    /**
     * 查询舱次信息
     * @param currPage 当前页
     */
    function getHoCabinFrequency() {
        //定义toast提示框
        var toast = new auiToast();
        var Url_IP = ToConfigure_IP("Gorgeous");
        var jsParms = new Object();
        /**
         * 舱次唯一标识
         */
        jsParms.cfId = api.pageParam.F_id;
        /**
         * 验证是否为空
         */
        if (jsParms.cfId == 0 || jsParms.cfId == undefined || jsParms.cfId == null) {
            return;
        }

        /**
         * 请求控制器
         */
        $.ajax({
            url: Url_IP + '/disinfectioninspection/hocabinfrequency/getHoCabinFrequency',
            type: 'post',
            async: false,
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(jsParms),
            success: function (result) {
                /**
                 * 验证返回信息是否为空
                 */
                if (result.success == true) {
                    /**
                     *  循环object
                     */
                    $.each(result.data.list, function (i, o) {
                        /**
                         * 升压时间
                         */
                        $("#corCompressionTime").val(o.cfCompression);
                        /**
                         * 减压时间
                         */
                        $("#corReduceTime").val(o.cfDecompression);
                        /**
                         * 出舱时间
                         */
                        $("#corOutCabinTime").val(o.cfOutCabin);
                        /**
                         * 稳压时间
                         */
                        $("#corStableTime").val(o.cfStablePressure);
                        /**
                         * 治疗压力
                         */
                        $("#corPressure").val(o.cfPressure);
                        /**
                         * 舱次名称
                         */
                        $("#corName").val(o.cfName);
                        /**
                         * 舱室
                         */
                        $("#corCiId").val(o.cfCiId);

                        $("#corCfId").val(o.cfId);
                         /**
                          * 登陆人赋值
                          **/ 
                        $("#corOneName").val(api.pageParam["userName"]);
                    })

                } else {
                }
            },
            error: function (result) {
            }
        });
    }


    /**
     * 查询舱次位置排仓人数总和
     * @param currPage 当前页
     */
    function getHoCabinFrequencyPeople() {
        //定义toast提示框
        var toast = new auiToast();
        var Url_IP = ToConfigure_IP("Gorgeous");
        var jsParms = new Object();
        /**
         * 舱次唯一标识
         */
        jsParms.cfId = api.pageParam.F_id;
        /**
         * 舱次位置唯一标识
         */
        jsParms.cfpCfId = api.pageParam.F_id;
        /**
         * 验证是否为空
         */
        if (jsParms.cfId == 0 || jsParms.cfId == undefined || jsParms.cfId == null) {
            return;
        }

        /**
         * 请求控制器
         */
        $.ajax({
            url: Url_IP + '/disinfectioninspection/hocabinfrequencyposition/getHoCabinFrequencyPeople',
            type: 'post',
            async: false,
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(jsParms),
            success: function (result) {
                /**
                 * 验证返回信息是否为空
                 */
                if (result.length > 0) {
                    /**
                     *  循环object
                     */
                    $.each(result, function (i, o) {
                        //舱内人数
                        $("#corWarehousing").val(o.cangnei);
                        //总人数
                        $("#corTotalNumberPeople").val(o.zong);
                        //开舱总数
                        $("#corTotalNumber").val(o.corTotalNumber);
                    })
                } else {

                }
            },
            error: function (result) {

            }
        });
    }

    /**
     * 添加操舱记录单
     */
    function insertHoCabinOperationRecord() {
        //定义toast提示框
        var toast = new auiToast();
        if ($("#corCfId").val() != null && $("#corCfId").val() != "") {
            //定义toast提示框
            var toast = new auiToast();
            //获取所属医院IP地址
            var Url_IP = ToConfigure_IP("Gorgeous");
            //获取参数
            var JsonStr = GetParameters();
            console.log(JsonStr);
            /**
             * 验证参数是否为空
             */
            if (JsonStr) {
                /**
                 * 请求控制器
                 */
                $.ajax({
                    url: Url_IP + '/businessmanagement/hocabinoperationrecord/insertHoCabinOperationRecord',
                    type: 'post',
                    contentType: "application/json",
                    dataType: "json",
                    data: JsonStr,
                    success: function (result) {
                        /**
                         * 验证是否成功
                         */
                        if (result.success == true) {
                            /***
                             * 删除舱次信息
                             */
                            removeHoCabinFrequency();
                        } else {
                            /**
                             *  提示错误信息
                             */
                            toast.fail({
                                title: "提交失败",
                                duration: 2000
                            });
                        }
                    },
                    error: function (result) {
                        /**
                         *  提示错误信息
                         */
                        toast.fail({
                            title: "提交失败",
                            duration: 2000
                        });
                    }
                });
            }
        } else {
            toast.fail({
                title: "请重新加载...",
                duration: 2000
            });
        }

    }

    /**
     * 查询字典业务
     * 
    */
    function Dictionaries() {
        //吸氧时程
        var corProgramme = "<option>请选择</option>";
        //操舱者2
        var corTwoName = "<option>请选择</option>";
        //护士
        var corNurse = "<option>请选择</option>";
        //技师
        var corTechnician = "<option>请选择</option>";
        //医生
        var corPhysician = "<option>请选择</option>";
        //操舱者1
        // var corOneName;
        //定义toast提示框
        var toast = new auiToast();
        var Url_IP = ToConfigure_IP("Gorgeous");
        $.ajax({
            url: Url_IP + '/businessmanagement/hocabinoperationrecord/dictionariesApp',
            type: 'post',
            async: false,
            contentType: "application/json",
            dataType: "json",
            data: {},
            success: function (result) {
                /**
                 * 验证返回信息是否为空
                 */
                if (result.data.list.length > 0) {
                    /**
                     *  循环object
                     */
                    $.each(result.data.list, function (i, o) {
                        if (o.dictionariesType === 177) {

                            //医生
                            corPhysician += "<option value=\"" + o.dictionariesName + "\">" + o.dictionariesName + "</option>";
                        }
                        else if (o.dictionariesType === 453) {
                            // 护士
                            corNurse += "<option value=\"" + o.dictionariesName + "\">" + o.dictionariesName + "</option>";
                        }
                        else if (o.dictionariesType === 436) {
                            // 技师
                            corTechnician += "<option value=\"" + o.dictionariesName + "\">" + o.dictionariesName + "</option>";
                        }
                        else if (o.dictionariesType === 463) {
                            // 操舱者2
                            corTwoName += "<option value=\"" + o.dictionariesName + "\">" + o.dictionariesName + "</option>";
                        }
                        else if (o.dictionariesType === 169) {
                            // 吸氧时程
                            corProgramme += "<option value=\"" + o.dictionariesName + "\">" + o.dictionariesName + "</option>";
                        }
                    })
                    // corOneName = "<option value=\"" + api.pageParam["userName"] + "\">" + api.pageParam["userName"] + "</option>";

                    //医生
                    $("#corPhysician").html(corPhysician);
                    //护士
                    $("#corNurse").html(corNurse);
                    //技师
                    $("#corTechnician").html(corTechnician);
                    //操舱者2
                    $("#corTwoName").html(corTwoName);
                    //吸氧时程1
                    $("#corProgrammeOne").html(corProgramme);
                    //吸氧时程2
                    $("#corProgrammeTwo").html(corProgramme);
                    // //操舱者1
                    // $("#corOneName").html(corOneName);

                } else {

                }
            },
            error: function (result) {

            }
        });
    }

    //  /**
    //  * 查询登陆人
    //  * @param currPage 当前页
    //  */
    //  function getUserInformation() {
    //     //定义toast提示框
    //     var UrlIP = ToConfigure_IP("Gorgeous");
    //     /**
    //      * 请求控制器
    //      */
    //     $.ajax({
    //         url: UrlIP + '/systemmanagement/userinformation/getUserInformation',
    //         type: 'post',
    //         async: false,
    //         contentType: "application/json",
    //         dataType: "json",
    //         data: parameter(),
    //         success: function (result) {
    //             /**
    //              * 验证返回信息是否为空
    //              */
    //             if (result.success == true) {
    //                 /**
    //                  *  循环object
    //                  */
    //                 $.each(result.data.list, function (i, o) {
    //                 // console.log("-------2-------："+result.data.list[0].userName);
    //                     //登陆人姓名
    //                     $("#corOneName").val(o.userName);
    //                 })
    //             } else {

    //             }
    //         },
    //         error: function (result) {

    //         }
    //     });
    // }


    /**
     * 提交完操舱记录单删除舱次
     */
    /**
     *  删除舱次信息
     *  @param
     */
    function removeHoCabinFrequency() {
        //定义toast提示框
        var toast = new auiToast();
        //获取所属医院IP地址
        var UrlIP = ToConfigure_IP("Gorgeous");
        /**
         * 组合条件
         * @type {Object}
         */
        var jsParms = new Object();

        /**
         * 舱次信息唯一Id
         */
        jsParms.cfId = api.pageParam.F_id;
        /**
         *  验证唯一标识是否为空
         */
        if (jsParms.cfId != "" && jsParms.cfId != undefined) {
            /**
             * 请求控制器
             */
            $.ajax({
                url: UrlIP + '/disinfectioninspection/hocabinfrequency/removeHoCabinFrequency',
                type: "post",
                async: false,
                contentType: "application/json",
                dataType: "json",
                data: JSON.stringify(jsParms),
                success: function (result) {
                    /**
                     * 验证返回信息是否正确
                     */
                    if (result.success == true) {
                        JumpPage();
                    } else {
                        /**
                         *  提示错误信息
                         */
                        toast.fail({
                            title: "错误信息，请检查数据",
                            duration: 2000
                        });
                    }
                },
                error: function (result) {
                    /**
                      *  提示错误信息
                      */
                    toast.fail({
                        title: "错误信息，请检查数据",
                        duration: 2000
                    });
                }
            });
        } else {
            /**
             * 没有唯一标识符提示错误信息
             */
            layui.notice.msg('Try later', { icon: 3 });
        }
    }

     /**
 * 查询操舱记录单信息
 * @param currPage 褰撳墠椤�
 */
function getHoCabinOperationRecord() {
    var toast = new auiToast();
        //获取所属医院IP地址
    var Url_IP = ToConfigure_IP("Gorgeous");
    /**
     * 实例化
     * @type {Object}
     */
    var jsParms = new Object();
    /**
     * 唯一ID
     * @type {jQuery}
     */
    jsParms.corId = api.pageParam.corId;
    /**
     * 璇锋眰鎺у埗鍣�
     */
    $.ajax({
        url: Url_IP + '/businessmanagement/hocabinoperationrecord/getHoCabinOperationRecord',
        type: 'post',
        async: false,
        contentType: "application/json",
        dataType: "json",
        data: JSON.stringify(jsParms),
        success: function (result) {
            /**
             * 楠岃瘉杩斿洖淇℃伅鏄惁涓虹┖
             */
            if (result.success == true) {
                $.each(result.data.list, function (i, o) {
                   /**
                         *
                         */
                         $("#corId").val(o.corId);
                        /**
                         *
                         */
                        $("#corCiId").val(o.corCiId);
                        /**
                         *
                         */
                        $("#corCfId").val(o.corCfId);
                        /**
                         *
                         */
                        $("#corOperationCabin").val(o.corOperationCabin);
                        /**
                         *
                         */
                        $("#corTechnician").val(o.corTechnician);
                        /**
                         *
                         */
                        $("#corPhysician").val(o.corPhysician);
                        /**
                         *
                         */
                        $("#corNurse").val(o.corNurse);
                        /**
                         *
                         */
                        $("#corOneName").val(o.corOneName);
                        /**
                         *
                         */
                        $("#corTwoName").val(o.corTwoName);
                        /**
                         *
                         */
                        $("#corAlone").val(o.corAlone);
                        /**
                         *
                         */
                        $("#corRescue").val(o.corRescue);
                        /**
                         *
                         */
                        $("#corTreatmentTour").val(o.corTreatmentTour);
                        /**
                         *
                         */
                        $("#corInspectionHand").val(o.corInspectionHand);
                        /**
                         *
                         */
                        $("#corPropagandaEdu").val(o.corPropagandaEdu);
                        /**
                         * 压力
                         */
                        $("#corPressure").val(o.corPressure);
                        /**
                         *
                         */
                        $("#corOpenTheCabin").val(o.corOpenTheCabin);
                        /**
                         *
                         */
                        $("#corWarehousing").val(o.corWarehousing);
                        /**
                         *
                         */
                        $("#corNewPatients").val(o.corNewPatients);
                        /**
                         *
                         */
                        $("#corTotalNumberPeople").val(o.corTotalNumberPeople);
                        /**
                         * 舱次总和
                         */
                        $("#corTotalNumber").val(o.corTotalNumber);
                        /**
                         *
                         */
                        $("#corOxygenOne").val(o.corOxygenOne);
                        /**
                         *
                         */
                        $("#corOxygenTwo").val(o.corOxygenTwo);
                        /**
                         *
                         */
                        $("#corOxygenThree").val(o.corOxygenThree);
                        /**
                         *
                         */
                        $("#corReduceConcentration").val(o.corReduceConcentration);
                        /**
                         * 加压前温度
                         */
                        $("#corCompressionTemp").val(o.corCompressionTemp);
                        /**
                         * 稳压始温度
                         */
                        $("#corStableTemp").val(o.corStableTemp);
                        /**
                         * 减压始温度
                         */
                        $("#corDecompressionTemp").val(o.corDecompressionTemp);
                        /**
                         * 减压末温度
                         */
                        $("#corReduceDegree").val(o.corReduceDegree);
                        /**
                         *
                         */
                        $("#corProgrammeOne").val(o.corProgrammeOne);
                        /**
                         *
                         */
                        $("#corProgrammeTwo").val(o.corProgrammeTwo);
                        /**
                         *
                         */
                        $("#corTreatmentDuration").val(o.corTreatmentDuration);
                        /**
                         * 加压时间
                         */
                        $("#corCompressionTime").val(o.corCompressionTime);
                        /**
                         * 稳压时间
                         */
                        $("#corStableTime").val(o.corStableTime);
                        /**
                         * 减压时间
                         */
                        $("#corReduceTime").val(o.corReduceTime);
                        /**
                         *
                         */
                        $("#corRemarks").text(o.corRemarks);
                        /**
                         * 出舱时间
                         */
                        $("#corOutCabinTime").val(o.corOutCabinTime);
                        /**
                         *
                         */
                        $("#corOperator").val(o.corOperator);
                        /**
                         *
                         */
                        $("#corOperTime").val(o.corOperTime);
                        /**
                         *
                         */
                        $("#corModifyTime").val(o.corModifyTime);
                        /**
                         *
                         */
                        $("#corHospital").val(o.corHospital);
                        /**
                         *
                         */
                        $("#corDel").val(o.corDel);
                })
            } else {
                /**
                 *  提示错误信息
                 */
                 toast.fail({
                    title: "提交失败",
                    duration: 2000
                });
            }
        },
        error: function (result) {
           /**
                 *  提示错误信息
                 */
                 toast.fail({
                    title: "提交失败",
                    duration: 2000
                });
        }
    })
}

//  //跳转页面
//  function JumpPage() {
//         var dialog = new auiDialog();
//         dialog.alert({
//             title: "提示",
//             msg: '操作成功，是否跳转',
//             buttons: ['取消', '确定']
//         }, function (ret) {
//             if (ret.buttonIndex === 1) {

//             } else if (ret.buttonIndex === 2) {
//                 api.historyBack({}, function (ret, err) {

//                     if (!ret.status) {
//                         api.closeWin();
//                     }
//                 });

//                 api.sendEvent({
//                     name: 'On_Site_Inspection',
//                     extra: {
//                         state: 'no'
//                     }
//                 });
//             }
//         })
//     }

    /**
 * 添加操舱记录单
 */
function updateHoCabinOperationRecord() {
    var toast = new auiToast();

     //获取所属医院IP地址
     var Url_IP = ToConfigure_IP("Gorgeous");
     //当前登陆人
     userName =api.pageParam["userName"]
       /**
         * 参数
         * 
         * */
         var JsonStr = GetParameters();
         //判断是否和之前的登陆人相同 
         if($("#corOneName").val()==userName){
        /**
         * 请求控制器
         */
        $.ajax({
            url: Url_IP + '/businessmanagement/hocabinoperationrecord/updateHoCabinOperationRecord',
            type: 'post',
            contentType: "application/json",
            dataType: "json",
            data: JsonStr,
            success: function (result) {
                /**
                 * 验证是否成功
                 */
                if (result.success == true) {
                    JumpPage();

                } else {
                     /**
                 *  提示错误信息
                 */
                 toast.fail({
                    title: "提交失败",
                    duration: 2000
                });
                }
            },
            error: function (result) {
                /**
                 *  提示错误信息
                 */
                 toast.fail({
                    title: "提交失败",
                    duration: 2000
                });
            }
        });
    }else{
          /**
                 *  提示错误信息
                 */
                 toast.fail({
                    title: "当前登陆人与之前登陆人不符，无法修改",
                    duration: 2000
                });
    }
}



    function GetParameters() {
        var jsParms = new Object();
        if(api.pageParam.corId>0){
        /**
         * 
         * 操舱记录单
         * */
         jsParms.corId = api.pageParam.corId;
        }
        /**
         *
         */
        jsParms.corCiId = $("#corCiId").val();
        /**
         *
         */
        jsParms.corCfId = $("#corCfId").val();
        /**
         *
         */
        jsParms.corOperationCabin = $("#corOperationCabin").val();
        /**
         *
         */
        jsParms.corTechnician = $("#corTechnician").val();
        /**
         *
         */
        jsParms.corPhysician = $("#corPhysician").val();
        /**
         *
         */
        jsParms.corNurse = $("#corNurse").val();
        /**
         *
         */
        jsParms.corOneName = $("#corOneName").val();
        /**
         *
         */
        jsParms.corTwoName = $("#corTwoName").val();
        /**
         *
         */
        jsParms.corAlone = $("#corAlone").val();
        /**
         *
         */
        jsParms.corRescue = $("#corRescue").val();
        /**
         *
         */
        jsParms.corTreatmentTour = $("#corTreatmentTour").val();
        /**
         *
         */
        jsParms.corInspectionHand = $("#corInspectionHand").val();
        /**
         *
         */
        jsParms.corPropagandaEdu = $("#corPropagandaEdu").val();
        /**
         *
         */
        jsParms.corPressure = $("#corPressure").val();
        /**
         *
         */
        jsParms.corOpenTheCabin = $("#corOpenTheCabin").val();
        /**
         *
         */
        jsParms.corWarehousing = $("#corWarehousing").val();
        jsParms.corTotalNumber = $("#corTotalNumber").val();
        jsParms.corTotalNumberPeople = $("#corTotalNumberPeople").val();
        /**
         *
         */
        jsParms.corNewPatients = $("#corNewPatients").val();
        /**
         *
         */
        jsParms.corWarehousing = $("#corWarehousing").val();
        /**
         *
         */
        jsParms.corOxygenOne = $("#corOxygenOne").val();
        /**
         *
         */
        jsParms.corOxygenTwo = $("#corOxygenTwo").val();
        /**
         *
         */
        jsParms.corOxygenThree = $("#corOxygenThree").val();
        /**
         *
         */
        jsParms.corReduceConcentration = $("#corReduceConcentration").val();
        /**
         *
         */
        jsParms.corCompressionTemp = $("#corCompressionTemp").val();
        /**
         *
         */
        jsParms.corStableTemp = $("#corStableTemp").val();
        /**
         *
         */
        jsParms.corDecompressionTemp = $("#corDecompressionTemp").val();
        /**
         *
         */
        jsParms.corReduceDegree = $("#corReduceDegree").val();
        /**
         *
         */
        jsParms.corProgrammeOne = $("#corProgrammeOne").val();
        /**
         *
         */
        jsParms.corProgrammeTwo = $("#corProgrammeTwo").val();
        /**
         *
         */
        jsParms.corTreatmentDuration = $("#corTreatmentDuration").val();
        /**
         *
         */
        jsParms.corCompressionTime = $("#corCompressionTime").val();
        /**
         *
         */
        jsParms.corStableTime = $("#corStableTime").val();
        /**
         *
         */
        jsParms.corReduceTime = $("#corReduceTime").val();
        /**
         *
         */
        jsParms.corRemarks = $("#corRemarks").text();
        /**
         *
         */
        jsParms.corOutCabinTime = $("#corOutCabinTime").val();
        /**
         *
         */
        jsParms.corOperator = $("#corOperator").val();
        /**
         *
         */
        jsParms.corOperTime = $("#corOperTime").val();
        /**
         *
         */
        jsParms.corModifyTime = $("#corModifyTime").val();
        /**
         *
         */
        jsParms.corHospital = $("#corHospital").val();
        /**
         *
         */
        jsParms.corDel = $("#corDel").val();
        return JSON.stringify(jsParms);
    }

     /**
     * 获取参数
     * （删，查）
     *  @param currPage 当前页
     *  @param userId 菜单ID
     */
     function parameter() {
        /**
         * 组合条件
         * @type {Object}
         */
        var jsParms = new Object();
        /**
         * 用户编号
         * @type {*|jQuery}
         */
        jsParms.userAccountNumber = api.pageParam["userName"] ;
        /**
         * 转成json数据
         */
        return JSON.stringify(jsParms);
    }
    
    //跳转页面
    function JumpPage() {
        var dialog = new auiDialog();
        dialog.alert({
            title: "提示",
            msg: '操作成功，是否跳转舱次信息',
            buttons: ['取消', '确定']
        }, function (ret) {
            if (ret.buttonIndex === 1) {

            } else if (ret.buttonIndex === 2) {
                api.historyBack({}, function (ret, err) {
                    api.sendEvent({
                        name: 'canbin',
                        extra: {
                            state: 'no'
                        }
                    });
                    if (!ret.status) {
                        api.closeWin();
                    }
                });

            }
        })
    }
</script>